package com.sky.dto.mapper;

import com.sky.dto.ShoppingCartDTO;

import com.sky.entity.OrderDetail;
import com.sky.entity.ShoppingCart;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;

@Mapper(componentModel = "spring")
public interface ShoppingCartDTOMapper {

    ShoppingCart toShoppingCart(ShoppingCartDTO shoppingCartDTO);

    @Mapping(target = "id", ignore = true) // 忽略id字段
    ShoppingCart orderDetailToShoppingCart(OrderDetail orderDetail);

}
